<?php
include 'conn.inc.php';
$num=$_GET["num"];//每页显示的个数
// $num=8;
$sql="select * from message";
$sth=$conn->prepare($sql);
$sth->execute();
$rows=$sth->fetchAll();
$totalnum=count($rows);//总记录数
$totalpage=ceil($totalnum/$num);
echo $totalpage;